UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ycesd+pSerrczvKdTpoDfvfedrCTwcAuKiqMwYI7VBY='
WHERE
key_id = 'c0a2693d9d1d78e993b756bf5889142fa94cb693cba55ac2f82faa4e0e26b39e'
AND (
token = 'Ycesd+pSerrczvKdTpoDfvfedrCTwcAuKiqMwYI7VBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)