UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yyK5APKcp7AWT6V05uyDsfpPSJkrK8phteGAUJ145TY='
WHERE
key_id = '742d30e765f377e5fae6ca0cc81855d5e0635e6162f7d9b826c6683324f3b34e'
AND (
token = 'yyK5APKcp7AWT6V05uyDsfpPSJkrK8phteGAUJ145TY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)