UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LgRFx87mdwWLqBpJ2eZ72fa3S5dFhtvRiS2pPd6awkw='
WHERE
key_id = '49da67a22c236ee9eacfa4220287e2609fc13378d80fc28d94047d5fb8396012'
AND (
token = 'LgRFx87mdwWLqBpJ2eZ72fa3S5dFhtvRiS2pPd6awkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)