UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x5+alXrGeBu9t5N4pRjzwbDsU117iCqYRiLqMrzEP64=' 
WHERE 
  key_id = '97c3239abef0648ac494ef6f4a6ef2d29a93b3b61b2966549961d6e94de29108' 
  AND (
    token = 'x5+alXrGeBu9t5N4pRjzwbDsU117iCqYRiLqMrzEP64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020