UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXwcGmVzs9vUcHys99SFmOYIlRawM/K1G/MATIIwOKI='
WHERE
key_id = '0cc0c750fbdd34b0019f538063f235b3f086995ece6a9f9e794e1ea90f4ade95'
AND (
token = 'RXwcGmVzs9vUcHys99SFmOYIlRawM/K1G/MATIIwOKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)