UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JyzWVObknPotH2om2EchhIbVDx/oSr7jhFhVvvKodc4='
WHERE
key_id = 'c76c5908f5da904e2c4303d328dfbad5c8a7fa26c29253ddd107ebc8d2242c46'
AND (
token = 'JyzWVObknPotH2om2EchhIbVDx/oSr7jhFhVvvKodc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)