UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8XmKoUWy7tiJgWgYvMwiDk0qepevc52XfkVNmOIvxU4='
WHERE
key_id = '889fc0829317b80879c5998214246b3548d87dbd36df809d034b33ec96ccf59d'
AND (
token = '8XmKoUWy7tiJgWgYvMwiDk0qepevc52XfkVNmOIvxU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)