UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v6M/7xO2lCmgVa8GKYdTiLSaEMRBLhQo1OJxXhL/Jxw='
WHERE
key_id = 'e40a4116b6582efdc2b1d459243e67424142206534f2052dcc66cf67133f969f'
AND (
token = 'v6M/7xO2lCmgVa8GKYdTiLSaEMRBLhQo1OJxXhL/Jxw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)