UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fve1+NTa0frQ/oZlSQUJ2YyYPbwdCeMH24TBjb+uWmU='
WHERE
key_id = '2528a7ff380247e399e9c1696bcab83dc2de7b4c33896d255c23a0559e6dc8f0'
AND (
token = 'fve1+NTa0frQ/oZlSQUJ2YyYPbwdCeMH24TBjb+uWmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)