UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5sTCR3F4qkGCbuzlAtjUvwmurjiuiONTK6J+1cQNHBo='
WHERE
key_id = '7c10ac160b1c5398faa1d80ca57b079c1d870b7f74736da031f91d353f326b1a'
AND (
token = '5sTCR3F4qkGCbuzlAtjUvwmurjiuiONTK6J+1cQNHBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)