UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'le/9nUN5PA/Q3Fx6p0LrMvzUyfuCxQnRzMgGAdX6mIk='
WHERE
key_id = 'e01be8136f2bfb6233d12df9053ee26ba1bcb944c0e508de266272ba876c444f'
AND (
token = 'le/9nUN5PA/Q3Fx6p0LrMvzUyfuCxQnRzMgGAdX6mIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)