UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1m6UynqO8hCZ28ZnA40LIkrKB89iJ2lwSsqo9m4waXY='
WHERE
key_id = '2ae344c3acb0cec92873f0b8b8887c9487e71d5c6fa18771a7eaaf8013d998a1'
AND (
token = '1m6UynqO8hCZ28ZnA40LIkrKB89iJ2lwSsqo9m4waXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)