UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jyyHezm+ozZROuQLWJyySXGC75/N3m3ZrKFzkcfVvwo='
WHERE
key_id = '9086c63c1abc271c78c9d8cd0a13c219efb365807ae624ff1797a24ddf6f2bc7'
AND (
token = 'jyyHezm+ozZROuQLWJyySXGC75/N3m3ZrKFzkcfVvwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)