UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wQ/e7uGRxw4sDkI9UJxNx5cVKJ9b7Dbt9nX3NeToDmY=' 
WHERE 
  key_id = '6456d2ae35a0cadbc6bd9673825aed744cd7693d94379fd891c2d1255e1f3cd6' 
  AND (
    token = 'wQ/e7uGRxw4sDkI9UJxNx5cVKJ9b7Dbt9nX3NeToDmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035