UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OCJZW7qX7FlzBYpyEPKgYdIXxHe/8han7eKzGGyL0o8='
WHERE
key_id = '54c19eba7b1d7fca15f2c831015abd56a76f38a773fab1aca7b6b5ebcf272eeb'
AND (
token = 'OCJZW7qX7FlzBYpyEPKgYdIXxHe/8han7eKzGGyL0o8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)