UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LQ0XUPoXBuf5kv8wuaXJUJpOooqlxDlDKCCDtrB0oDk='
WHERE
key_id = 'c20e02fad718ec349e51c53e4db14f56ef7cc1ee0e872e89e1d985050d3accaa'
AND (
token = 'LQ0XUPoXBuf5kv8wuaXJUJpOooqlxDlDKCCDtrB0oDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)