UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DoFhzLqqSoikefoD9EfplLwSUYKFZSG9Fvdi3IQ1zf4='
WHERE
key_id = '88529c7f7af9a0e2be7c4c0cf3d8c1c89d12b45328ba21df0aed1907f3008eb1'
AND (
token = 'DoFhzLqqSoikefoD9EfplLwSUYKFZSG9Fvdi3IQ1zf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)