UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cXEbYa3H5OiQehazGEk2xS8U/c+9G1N+iT/LxgMzun4='
WHERE
key_id = '3abe857fc30065cfa6c3954f4a3339d1132c67265ef598d28282d2b0de4e3beb'
AND (
token = 'cXEbYa3H5OiQehazGEk2xS8U/c+9G1N+iT/LxgMzun4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)