UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WJhVzXmUWL3I3IUAOPjSPleCXQGS1hO+YWVFrY4Pkuo='
WHERE
key_id = '465e309bd4bac68879aae0437a87d19d17fb90d898e5ac9e464dd9d748a88920'
AND (
token = 'WJhVzXmUWL3I3IUAOPjSPleCXQGS1hO+YWVFrY4Pkuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)