UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pWXckIX+Wj1lsaKbV1z852lLrCugBjqOb0AGdJgU69A='
WHERE
key_id = '245c5f63eed7e64008c7890d948a07645d8f2bcc5e4755f05f1942645dc98e38'
AND (
token = 'pWXckIX+Wj1lsaKbV1z852lLrCugBjqOb0AGdJgU69A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)