UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mPEscVYZTmj9WYAUlVfhV61SVmyeRbBJpsVumIHqDYM='
WHERE
key_id = '04ae233365d5aae9d0cb81d091ae36cc3bef0f80a41e09c8aa5bbac578e3a024'
AND (
token = 'mPEscVYZTmj9WYAUlVfhV61SVmyeRbBJpsVumIHqDYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)