UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'szcbVxfKpyZO9r+QojZxm6Vlt/IJRsu2s9Ytpxd3VIs='
WHERE
key_id = 'f2fbca7ce867ddc9fb4557935d6367dc7ee2ff590f7748f9b031fc3f8abe1c2a'
AND (
token = 'szcbVxfKpyZO9r+QojZxm6Vlt/IJRsu2s9Ytpxd3VIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)