UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OvVqqNlqWHZ3Or2W6jDhyLKse/dPs14veX9h/3mrpeg='
WHERE
key_id = '5f80af606fdc846c21dedbf67985f89d349227ad7e2213e008bd5ad29294185e'
AND (
token = 'OvVqqNlqWHZ3Or2W6jDhyLKse/dPs14veX9h/3mrpeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)