UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+0niq3SdyVKF0cMgMROA11YZqmUZ3qDF2gM2cd0ytsY='
WHERE
key_id = '4774aff27982f6ae534cf6caa365707a4017ccff8301cf344c224321d0166dc7'
AND (
token = '+0niq3SdyVKF0cMgMROA11YZqmUZ3qDF2gM2cd0ytsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)