UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HeTTyh3Ob8+o4ZLznJCRIwf3zPqJEL4oGcbCY1PlUvA='
WHERE
key_id = 'e8451cfb472775b44800959da6cb6d6ee787ec6233a610d55ea344c4006b9c92'
AND (
token = 'HeTTyh3Ob8+o4ZLznJCRIwf3zPqJEL4oGcbCY1PlUvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)