UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H8MYuG7nBtihKjUwCgdU+S0pO5UV2/JWDbwbJD/47VQ='
WHERE
key_id = '2f9459728c59e2b2fd6eddba0930f546846e9ef57107edef4ce59527630a598b'
AND (
token = 'H8MYuG7nBtihKjUwCgdU+S0pO5UV2/JWDbwbJD/47VQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)