UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fCcyGrqZFblSEtAMFuQqx8wkAazFn9kQStbvLCZvVCI='
WHERE
key_id = '263a0794cf500299e026f9e2489588f828ed32af3a5aa70b62a6e78b554d9d0d'
AND (
token = 'fCcyGrqZFblSEtAMFuQqx8wkAazFn9kQStbvLCZvVCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)