UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qfYlAYrJ1zzUt2XO6piz9mV72EO/HoBaI/TXG+5TmtE='
WHERE
key_id = '574d96d7fc4329daca097ec0629cd4cf1e2027d70c7b3a1bd2ecf6c993297824'
AND (
token = 'qfYlAYrJ1zzUt2XO6piz9mV72EO/HoBaI/TXG+5TmtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)