UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o8qTdWC9GmFZtPLlblmzgC1kba/1+hdGSUGkl6PQDvo='
WHERE
key_id = '9246d7828cf16dcb96711bc35ea8136a91af103c3a0f4f6f31885a738ea83b22'
AND (
token = 'o8qTdWC9GmFZtPLlblmzgC1kba/1+hdGSUGkl6PQDvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)