UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCWFx8PuUHyi411/dUeOCLQ5vXpN7gXHiHhoSIdtERM='
WHERE
key_id = '56c587c216f3d1fc105523f2442ef91228225951aafa1e94ebcee1ac316e8323'
AND (
token = 'mCWFx8PuUHyi411/dUeOCLQ5vXpN7gXHiHhoSIdtERM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)