UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpo5uXgyu2pSF3pK6bX7o7OkejTYdY8XNF/YypOFWh8='
WHERE
key_id = 'cabed0de637322d5537defb83fd3835da0d36b44fd4a3236f3547febd128d91f'
AND (
token = 'xpo5uXgyu2pSF3pK6bX7o7OkejTYdY8XNF/YypOFWh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)