UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rB6TohmRlyg26O17kG41dDaMucX8fuy220+bF4RuKGY='
WHERE
key_id = '760f8175b1b670554fabc5554f9e883beddee6c499882804b4624860b0e3d1b6'
AND (
token = 'rB6TohmRlyg26O17kG41dDaMucX8fuy220+bF4RuKGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)