UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UjYea8F9lTspphmmrA16c/o2TUJ/XqWnLku6evvk5NY='
WHERE
key_id = '39bfc7a341efdca1ae6849c5908d476984dca5092c9dba3bc7236056bb6f8924'
AND (
token = 'UjYea8F9lTspphmmrA16c/o2TUJ/XqWnLku6evvk5NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)