UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G1vOppT5t6dIXOawEQg0tJ5teC95DhhtfAcGzf3qiP8='
WHERE
key_id = '9152d4d2075f7b9e83bfbabaff83986dabf0671f202e1b466b2ed75e6a040b50'
AND (
token = 'G1vOppT5t6dIXOawEQg0tJ5teC95DhhtfAcGzf3qiP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)